package com.competition.prediction.mapper;

import com.competition.prediction.entity.UserBet;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserBetMapper {

    int insertUserBet(UserBet userBet);

    int updateUserBet(UserBet userBet);

    UserBet selectUserBetById(Long id);

    List<UserBet> selectUserBetsByUserId(@Param("userId") Long userId);

    List<UserBet> selectUserBetsByCompetitionId(@Param("competitionId") Long competitionId);

    int updateBetStatus(@Param("id") Long id, @Param("status") Integer status, @Param("actualReturn") Long actualReturn);
}